-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Guava's collection factories by standard Java #202
Replace Guava's collection factories by standard Java #202
Conversation
50c5e05
to
5bd14ad
Compare
Generally I like the idea of reducing the amount of dependencies, especially as they are not needed anymore with newer versions of Java. I would like to merge this (and further merge other changes completely removing Guava). However, here I would like to discuss this with @sailingKieler first, as from earlier I remember he had some objections from making the source code base incompatible with Java 1.8 in the past. I have no objections to have the main branch of this project getting incompatible with deprecated Java versions, so that further development can use such newer features, and older systems using Java 1.8 can use older releases, or update Java as well. The code changes look good, with a few changes of which I am not entirely sure from just looking at the diff if that has the same behavior or if the tests cover that. Have you tested the code yourself at those parts, where you did not just replace the list/map constructors? |
Thanks for having a look at this!
Of course. I just want to mention that Java-11 is already required and the generated byte-code probably already targets Java-11 JVMs. And since the project is configured to build with Java-11 sooner or later Java-11 will probably be used intentionally or unintentionally.
Oh looks like some of the non-trivial changes already slipped into this. Let me remove them for this one. I can propose them in a follow-up again.
As far as I can tell it is usually recommended to not use linked list since |
Sure, I already updated to this to make the build compatible with newer Eclipse releases. Generally I would like to eventually update this project to at least Java-17.
For most of the Eclipse / Eclipse UI stuff I am also not an expert, as I have never really touched that and only worked on the standalone / language server part of KLighD, but I can test a few further things if you provide more changes.
This was not my code, but I do not think there was a specific preference of using linked lists over array lists. I was just curious to if this has anything to do with the Guava dependencies. You can leave that in this PR, I do not mind. Especially if it is just for lists which never really get that big where a performance difference would be noticable. |
5bd14ad
to
ebc6619
Compare
That would be nice. :)
Understand. I can try it also with our Eclipse App where we integrate KLighD.
Yes in the end it is probably irrelevant what's used. Thanks. |
@sailingKieler any update from your side on this topic? |
ebc6619
to
db0566e
Compare
- Replace LinkedList with ArrayList or ArrayDeque Part of kieler#199
db0566e
to
0356b86
Compare
Hi @HannesWell, @NiklasRentzCAU sorry for being silent in the past, there was summer vacation time, etc. Thank's a lot for your effort Hannes! |
No problem, you were not the only one :)
Great! I'm glad you appreciate this work. |
@NiklasRentzCAU can we then continue this one? Thanks in advance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, good start for removing this dependency. I'll accept and merge this, though two notes:
- changing PlacementUtil.findChildArea's second parameter from a LinkedList to a Deque would probably technically considered an API-breaking change that is not necessary for this change, however Deque being an implemented interface of LinkedList, this should not cause any breaking code or even in binary replacement (at least from what I understand). I think I would like to keep the API as-is if not required (e.g. API using Guava directly).
- The change in the TextActivator code is a change in code generated automatically by Xtext, which should generally never be manually updated. However, the code has not been re-generated since Xtext 2.10 and the corresponding .mwe2 workflow file does not work anyways, I don't know when this broke, but also do not have any urge to fix that. I saw you also proposed changes in Xtext, so I'll let this slip for now. If there are not too many Guava dependencies in automatically-generated code, this is probably fine, but if many more occur, this might be a problem if this code should be re-generated anytime in the future (which I would like to not block). We should keep an eye on this.
Thanks again @HannesWell! Sorry for the delay, holiday and a conference also hindered me in looking into this earlier. Now I got a little more time to look at this again! |
Thank you for your review and no problem for the delay.
Almost any change in the method signature (except changing parameter names) is a binary incompatible change, even changing the return type in a source compatible way: So yes this is indeed a breaking change. I assume I get wrong that you consider this an API.
Agree. If I have some time I can have a look why the workflow fails. |
I think a good way forward is to deprecate any API that might be used somewhere and replace other internal occurrences silently. Technically API is anything that is public, but I would exclude anything that is defined in internal folders or code that is obviously meant for internal use and not as part of KLighD's API (such as the Iterables2 class you looked at).
The first failure is related to previous restructuring in the code, as the test code is now located elsewhere. The second failure after fixing that is related to the xbase import of the GRandom.xtext grammar not getting resolved. Here is where I left digging further. |
Part of #199